package yyy.ab.logging.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import yyy.ab.common.core.BaseEntity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * 系统日志
 */
@Getter
@Setter
@TableName(value = "sys_log")
public class SysLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "id", hidden = true)
    private Long id;

    /** 操作用户 */
    private String username;

    /** 描述 */
    private String description;

    /** 方法名 */
    private String method;

    /** 参数 */
    private String params;

    /** 日志类型 */
    private String logType;

    /** 请求ip */
    private String requestIp;

    /** 地址 */
    private String address;

    /** 浏览器  */
    private String browser;

    /** 请求耗时 */
    private Long time;

    /** 异常类型 **/
    private String exceptionType;

    /** 异常详细  */
    private String exceptionDetail;

    /** 创建日期 */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Timestamp createTime;

    public SysLog(){

    }

    public SysLog(String logType, Long time) {
        this.logType = logType;
        this.time = time;
    }
}
